<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery.js"></script>
    <script src="../js/pintuer.js"></script>
</head>
<body>
<form method="post" action="" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 会议列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
            <ul class="search" style="padding-left:10px;">                        <%--    "MeetingServlet?flag=6"--%>
                <li> <a class="button border-main icon-plus-square-o" href="BoardroomServlet?flag=6&currentPage=1"> 预定会议</a> </li>
                <%--<li>
                    <div class="label">
                        <label>请选择搜索方式</label>
                    </div>
                  <select id="serachId" name="serachId" class="input" style="width:200px; line-height:17px;">
                    <option value="1">会议id</option>
                    <option value="2">会议名字</option>
                    <option value="3">会议室</option>
                    <option value="4">预订人</option>
                    <option value="5">会议内容</option>
                    <option value="6">会议开始时间</option>
                    <option value="7">会议结束时间</option>
                    <option value="8">会议预定时间</option>
                  </select>
                </li>--%>
                <%--<li>
                    <input type="text" id="keyWord" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" />
                    <a href="javascript:changesearch()" class="button border-main icon-search"> 搜索</a></li>--%>
            </ul>
        </div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">会议ID</th>
                <th>会议名称</th>
                <th>会议室</th>
                <th>预订人</th>
                <%--        <th>会议内容</th>--%>
                <th width="10%">会议开始时间</th>
                <th width="10%">会议结束时间</th>
                <th width="10%">会议预定时间</th>
                <th width="310">操作</th>
            </tr>
            <c:forEach items="${pb.list}" var="room" varStatus="status">



                <tr>
                    <td style="text-align:left; padding-left:20px;">
                            ${room.id}
                    </td>

                    <td width="10%">${room.mName}</td>
                    <td>${room.rName}</td>
                    <td>
                            ${room.wName}
                    </td>
                        <%--          <td>${room.content}</td>--%>
                    <td>${(room.tStart)}</td>
                    <td>${room.tEnd}</td>
                    <td>${room.tReserve}</td>
                    <td>
                        <div class="button-group">
                                <%--<a class="button border-main" href="MeetingServlet?flag=3&id=${room.id}">
                                    <span class="icon-edit"></span> 修改
                                </a> &nbsp;--%>
                            <a class="button border-red" href="javascript:mydel('${room.id}')" >
                                <span class="icon-trash-o"></span> 取消会议</a>
                                    &nbsp;
                            <a class="button border-main icon-plus-square-o" href="MeetingServlet?flag=7&tag=1&mid=${room.id}">
                                会议确认情况</a><br>
                            <a class="button border-main icon-plus-square-o" href="MeetingServlet?flag=7&tag=0&mid=${room.id}">
                                会议未确认情况</a>
                        </div>

                    </td>
                </tr>


            </c:forEach>


            <c:if test="${pb.currentPage == 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="MeetingServlet?flag=1&page=1">首页</a>
                            <span class="current" style="background-color: #bbbbbb;border: 0px">上一页</span>
                            <span class="current">${pb.currentPage}</span>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage+1}">${pb.currentPage+1}</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage+2}">${pb.currentPage+2}</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage+1}">下一页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
            </c:if>
            <c:if test="${pb.currentPage == pb.totalPage && pb.currentPage != 1 && pb.totalPage != 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="MeetingServlet?flag=1&page=1">首页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage-1}">上一页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage-1}">${pb.currentPage-1}</a>
                            <span class="current">${pb.currentPage}</span>
                            <span class="current" style="background-color: #bbbbbb;border: 0px">下一页</span>
                            <a href="MeetingServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
            </c:if>
            <c:if test="${pb.currentPage != 1 && pb.currentPage != pb.totalPage && pb.totalPage != 1}">
                <tr>
                    <td colspan="8">
                        <div class="pagelist">
                            一共有 ${pb.totalCount} 条数据,共${pb.totalPage}页
                            <a href="MeetingServlet?flag=1&page=1">首页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage-1}">上一页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage-1}">${pb.currentPage-1}</a>
                            <span class="current">${pb.currentPage}</span>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage+1}">${pb.currentPage+1}</a>
                            <a href="MeetingServlet?flag=1&page=${pb.currentPage+1}">下一页</a>
                            <a href="MeetingServlet?flag=1&page=${pb.totalPage}">尾页</a>
                        </div></td>
                </tr>
            </c:if>

        </table>
    </div>
</form>
<script type="text/javascript">

    function mydel(Id){
        //alert(teaId);
        if(confirm("您确定要取消会议吗？")){
            //alert(this);
            var str = "MeetingServlet?flag=5&id=" + Id;
            location.href= str;
        }
    }

    //搜索
    function changesearch(){
        var keyWord = $("#keyWord").val();
        var searchId = $("#serachId").val();
        location.href="MeetingServlet?flag=6&id=" + searchId + "&keyWord=" + keyWord;
    }


</script>
</body>
</html>